package com.example.springboot_demo.controller;

import com.example.springboot_demo.annotation.DemoAnnotation;
import com.example.springboot_demo.entity.Demo;
import io.micrometer.core.annotation.Timed;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {
    @Autowired
    Demo demo;
    @DemoAnnotation
    @RequestMapping(value = "demo1")
    @Timed(value = "user.get.time", description = "Get user by id", percentiles = {0.5, 0.95, 0.99},
            histogram = true)
    public String test()
    {
        System.out.println(demo.getLikes());
        return demo.getAge()+"";
    }
}
